'use strict';

module.exports = app => {
  class Controller extends app.Controller {
    async server() {

      console.log('🐯🐯🐯 ~ file: chat.js:10 ~ Controller ~ index ~ message：');

      const { ctx, app } = this;

      const message = this.ctx.args[0];
      const socket = ctx.socket;
      const client = socket.id;
      const nsp = app.io.of('/');


      socket.on('chats', msg => {
        console.log('message: ' + msg);
      });

    }

    async disconnect() {
      const message = this.ctx.args[0];
      console.log('0000', message);
    }
  }
  return Controller;
};
